﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FarmacieDAL
{
    public class MedicamenteManager
    {
        private static List<Medicament> toateMedicamentele;
        private static FarmacieEntities entities;

        public static void Initialize(FarmacieEntities entitiesContext)
        {
            toateMedicamentele = new List<Medicament>();
            entities = entitiesContext;

            toateMedicamentele = entities.Medicament.Where(x => !x.Deleted).ToList();
        }

        public static void Refresh()
        {
            toateMedicamentele.Clear();
            toateMedicamentele.AddRange(entities.Medicament.Where(x => !x.Deleted));
        }

        public static List<Medicament> ToateMedicamentele
        {
            get
            {
                return toateMedicamentele;
            }
        }
    }
}
